package com.jvxb.manage.livable.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author jvxb
 * @since 2020-06-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_user")
@ApiModel(value = "SysUser对象", description = "系统用户表")
public class SysUser implements Serializable {

    public static final String CREATE_TIME = "create_time";
    public static final String ID = "id";
    public static final String PASSWORD = "password";
    public static final String PHONE = "phone";
    public static final String LOGIN_NAME = "login_name";
    public static final String ROLE_ID = "role_id";
    public static final String ROLE_NAME = "role_name";
    public static final String USER_NAME = "user_name";
    public static final String USER_CODE = "user_code";
    public static final String VALID = "valid";
    public static final String DEPARTMENT_NAME = "departmentName";
    private static final long serialVersionUID = -5457955660275598443L;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value = "用户密码")
    private String password;
    @ApiModelProperty(value = "用户手机号码")
    private String phone;
    @ApiModelProperty(value = "登录名")
    private String loginName;
    @ApiModelProperty(value = "所属角色id")
    private Integer roleId;
    @ApiModelProperty(value = "所属角色 (冗余设计)")
    private String roleName;
    @ApiModelProperty(value = "用户名")
    private String userName;
    @ApiModelProperty(value = "用户工号")
    private String userCode;
    @ApiModelProperty(value = "帐号是否有效 0 无效 1有效")
    private String valid;
    @ApiModelProperty(value = "用户所属部门")
    private String departmentName;

}
